import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart';
import 'package:my_app/builder/zhujie/generate_info.dart';
import 'package:source_gen/source_gen.dart';

// 根据注解生成代码
class AptBuilder extends GeneratorForAnnotation<GenerateInfo> {
  @override
  generateForAnnotatedElement(
      Element element, ConstantReader annotation, BuildStep buildStep) {
    return "String a = 'i love flutter';";
  }
}

// LibraryBuilder 生成独立的dart文件
Builder testApt(BuilderOptions options) => LibraryBuilder(AptBuilder());
